<template>
    <el-row :gutter="24" style="margin-top:16px">
        <el-col :md="3" :sm="6" style="text-align: center;line-height: 32px;">{{ name }}</el-col>
        <el-col :sm="4">
            <el-select v-model="data.codec" :placeholder="$t('select_placeholder')" style="width: 100%;">
                <el-option v-for="item in audioCodecOptions" :key="item.value" :label="item.label" :value="item.value"
                    :disabled="item.disabled"></el-option>
            </el-select>
        </el-col>
        <el-col :md="4">
            <el-select v-model="data.audioSrc" :placeholder="$t('select_placeholder')" style="width: 100%;">
                <el-option v-for="item in audioSourceOptions" :key="item.value" :label="item.label" :value="item.value"
                    :disabled="item.disabled"></el-option>
            </el-select>
        </el-col>
        <el-col :sm="4">
            <el-select v-model="data.gain" :placeholder="$t('select_placeholder')" style="width: 100%;">
                <el-option v-for="item in gainOptions" :key="item.value" :label="item.label" :value="item.value"
                    :disabled="item.disabled"></el-option>
            </el-select>
        </el-col>
        <el-col :sm="3">
            <el-select v-model="data.samplerate" :placeholder="$t('select_placeholder')" style="width: 100%;">
                <el-option v-for="item in samplerateOptions" :key="item.value" :label="item.label" :value="item.value"
                    :disabled="item.disabled"></el-option>
            </el-select>
        </el-col>
        <el-col :md="3" :sm="6">
            <el-select v-model="data.channels" :placeholder="$t('select_placeholder')" style="width: 100%;">
                <el-option :label="$t('mono')" :value="1"></el-option>
                <el-option :label="$t('stereo')" :value="2"></el-option>
            </el-select>
        </el-col>
        <el-col :md="3" :sm="6">
            <el-input v-model="data.bitrate" :placeholder="$t('input_placeholder')"></el-input>
        </el-col>
    </el-row>
</template>
  
<script setup name="video-stream">
const props = defineProps(['name', 'data', 'audioSourceOptions', 'audioCodecOptions', 'gainOptions', 'samplerateOptions'])
let name = ref('')
let data = reactive({})
let audioSourceOptions = ref([])
let audioCodecOptions = ref([])
let gainOptions = ref([])
let samplerateOptions = ref([])
watchEffect(() => {
    name.value = props.name
    data = props.data
    audioSourceOptions.value = props.audioSourceOptions
    audioCodecOptions.value = props.audioCodecOptions
    gainOptions.value = props.gainOptions
    samplerateOptions.value = props.samplerateOptions
})
onUnmounted(() => {

});

</script>
  
<style scoped lang="scss">
.encode-setting {}
</style>
  
  